%function to check overlap of
% time IDs
%latest date 22.10.2002

function [flag] = IsOver(a,b,c,d)

	if a<c&a<d&b<c&b<d,
	case1 = 1;
	elseif a>c&a>d&b>c&b>d,
	case1 = 2;
	elseif a>c&a<d&b>c&b>d,
	case1 = 3;
	elseif a<=c&a<d&b>c&b<d,
	case1 = 4;
	elseif a<=c&a<d&b>c&b>d,
	case1 = 5;
	elseif a>c&a<d&b>c&b<d,
      case1 = 6;
   elseif a==c&b==d,
      case1 = 7;
      end;
if case1 > 2,
flag = 1;
else,
flag = 0;
end;
